/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.commodity.service.impl;

import java.util.List;

import iaas.enums.StatusEnum;
import iaas.service.impl.BaseServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.wealth.commodity.entity.Search;
import com.wealth.commodity.enums.SearchStatusEnum;
import com.wealth.commodity.repository.SearchDao;
import com.wealth.commodity.service.ISearchService;

/**
 * @author chan
 * @version 1.0
 * @since 1.0
 */
 
@Component
public class SearchServiceImpl extends BaseServiceImpl<Search> implements ISearchService{

	@Autowired
	private SearchDao searchDao;

	//根据市场查询热搜词
	@Override
	public List<Search> findByMarketId(Long marketId) {
		return searchDao.findByMarketId(marketId);
	}

	@Override
	public List<Search> findByPCAndStatus() throws Exception {
		return searchDao.findByStatusAndType(StatusEnum.NORMAL.getValue(), SearchStatusEnum.PC.getValue());
	}
	
}
